package fork.join.main;

import java.nio.file.Path;
import java.nio.file.Paths;

import fork.join.exception.ScanException;
import fork.join.scanner.FolderScanner;


public class Main
{
    private static final Path CHEMIN = Paths.get( "D:\\" );
    private static final String FILTRE = "*.py";

    public static void main( String[] args )
    {
        FolderScanner fs = new FolderScanner( CHEMIN, FILTRE );

        try
        {
            Long start = System.currentTimeMillis( );
            Long resultat = fs.sequentialScan( );
            Long end = System.currentTimeMillis( );
            System.out.println( "Il y a " + resultat + " fichier(s) portant l'extension " + FILTRE );
            System.out.println( "Temps de traitement : " + ( end - start ) );
        }
        catch ( ScanException e )
        {
            e.printStackTrace( );
        }
    }
}